#ifndef MYTITLEBAR_H
#define MYTITLEBAR_H

#include <QWidget>
#include <QMouseEvent>

namespace Ui {
class mytitlebar;
}

class mytitlebar : public QWidget
{
    Q_OBJECT

public:
    explicit mytitlebar(QWidget *parent = nullptr);
    ~mytitlebar();
    void setmyParent(QWidget *parent);

signals:
    void showSetWindow();
    void showMinWindow();
    void closeMyWindow();

protected:
    void mouseMoveEvent(QMouseEvent *event);
    void mousePressEvent(QMouseEvent *event);

private slots:
    //设置页
    void on_setBtn_clicked();
    //最小化
    void on_minBtn_clicked();
    //关闭程序
    void on_closeBtn_clicked();

private:
    Ui::mytitlebar *ui;
    QWidget* m_parent = NULL;
    QPoint m_pt;
};

#endif // MYTITLEBAR_H
